CC = g++
AR = ar cru
SRC = ../antx/antx/antx.cc  ../antx/antx/thread.cc ../antx/antx/exmonwaiter.cc ../antx/antx/clientAcl.cc \
 cobweb/Helper.cc cobweb/consDriver.cc cobweb/Events.cc 

CFLAGS = -Wall -D_REENTRANT -D_GNU_SOURCE -fPIC  -g3
SOFLAGS = -shared
LDFLAGS =   # -lresolv

LINKER = $(CC)
LINT = lint -c
RM = /bin/rm -f

LIBS = -L/home/y/lib -L/usr/local/lib -L/usr/lib  \
	    -pthread -lstdc++  -ldl -lglib-2.0 -lrt   -lmemcached

INCLUDES =  -I/home/y/include -I/usr/local/include -I./cobweb  -I../antx/antx -I/usr/include  -I/home/y/include/glib-2.0 

STATIC_LIB = /home/y/lib/libevent.a #/home/y/lib/libmemcached.a  /usr/lib/libglib-2.0.a 
 
OPTFLAG =  -fno-default-inline -fno-strict-aliasing `pkg-config --cflags --libs glib-2.0 gthread-2.0` 

CFLAGS  += $(INCLUDES) 
CFLAGS  += $(OPTFLAG) 
LDFLAGS += $(LIBS) 
#--------------------------------------------------------------------
OBJS = $(SRC:.cc=.o)
TARGET = bin/cobweb
#--------------------------------------------------------------------
all:$(TARGET)
bin/cobwebD:$(OBJS)
	$(LINKER) $(LDFLAGS) $(OPTFLAG) $(OBJS) $(STATIC_LIB) -o $@

clean:
	@( $(RM) *.o vgcore.*  $(TARGET) )
	rm ../antx/antx/*.o  cobweb/*.o 
#--------------------------------------------------------------------
# make rule
%.o : %.cc
	$(CC) $(CFLAGS) -c $^ -o $@	

%.o : %.cpp
	$(CC) $(CFLAGS) -c $^ -o $@	

